package com.project.service.core.impl;

import com.project.mapper.core.AdminMapper;
import com.project.model.core.Admin;
import com.project.service.common.impl.BaseServiceImpl;
import com.project.service.core.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户Service实现类
 *
 * @author wyy
 * @date 2019-08-26 03:55
 */
@Service("adminServiceImpl")
public class AdminServiceImpl extends BaseServiceImpl<Admin, Long> implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    /**
     * 根据名称查询用户
     *
     * @param loginName 登录名称
     * @return
     */
    @Override
    public Admin getByLoginName(String loginName) {
        return adminMapper.getByLoginName(loginName);
    }

    /**
     * 及联查询用户
     *
     * @param admin 用户
     * @return
     */
    @Override
    public List<Admin> getAdminCascadeRole(Admin admin) {
        return adminMapper.getAdminCascadeRole(admin);
    }
}
